package com.itzdm.client.client;

import com.itzdm.client.config.DefaultFeignConfig;
import com.itzdm.client.domain.UserSearchDto;
import com.itzdm.client.fallback.UserFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @作者：张德明
 * @时间：2025/4/5 15:41
 */
@FeignClient(value = "user-service",fallback = UserFallback.class,configuration = DefaultFeignConfig.class)
public interface UserClient {
    /**
     * 获取用户信息
     * @param keyword
     * @return
     */
    @GetMapping("/user/getUserInfoByKeyword")
    UserSearchDto getUserInfo(@RequestParam("keyword") String keyword);


    @GetMapping("/user/getUserInfoById")
    UserSearchDto getUserInfoById(@RequestParam("userId") Long userId);

    /**
     * 批量获取用户信息
     * @param userIds
     * @return
     */
    @GetMapping("/user/search/ids")
    List<UserSearchDto> getUserInfoByIds(@RequestParam("userIds") List<Long> userIds);
}
